- name: install packages
  package: name={{ item }} state=present
  with_items:
  - koschei-frontend
  - koschei-frontend-fedora
  - koschei-frontend-copr
  - mod_auth_openid
  tags:
  - koschei
  - packages

- name: install config files
  template: >
    src="{{ item }}.j2"
    dest="/etc/koschei/{{ item }}"
    owner=koschei
    group=koschei
    mode=0400
  with_items:
  - config-frontend.cfg
  notify:
  - reload httpd
  tags:
  - koschei
  - config

- name: install httpd config file
  template: >
    src="httpd.conf.j2"
    dest="/etc/httpd/conf.d/koschei.conf"
  notify:
  - reload httpd
  tags:
  - koschei
  - config

- name: set httpd selinux booleans
  seboolean: name={{ item }} state=yes persistent=yes
  with_items:
  - httpd_can_network_connect
  - httpd_can_network_connect_db
  - httpd_can_network_memcache
  notify:
  - reload httpd
  tags:
  - koschei
  - selinux

- name: enable httpd to start on boot
  service: name=httpd state=started enabled=true
  tags:
  - koschei
  - service
